Add E2E tests for login, login_with_cert and sudoer functionality#97
Merged
liweinan merged 4 commits intoalchemy-studio:masterfrom Feb 20, 2026
Merged
Conversation
Contributor
liweinan
commented
Feb 20, 2026
- Add test dependencies (tower, http-body-util, hyper) to Cargo.toml
- Create test utilities in htyuc/tests/common/mod.rs
- Add 20 E2E test cases covering:
- login_with_password: success, wrong password, missing credentials
- login_with_cert: invalid signature, missing data
- sudo/sudo2: auth validation, token verification
- verify_jwt_token and generate_key_pair endpoints
- Add Docker Compose config for test PostgreSQL and Redis
- Add test data initialization SQL fixtures
- Add test runner script (scripts/run_tests.sh)
- Update GitHub Actions CI to run E2E tests with services
- Update README with E2E testing documentation
- Add test dependencies (tower, http-body-util, hyper) to Cargo.toml - Create test utilities in htyuc/tests/common/mod.rs - Add 20 E2E test cases covering: - login_with_password: success, wrong password, missing credentials - login_with_cert: invalid signature, missing data - sudo/sudo2: auth validation, token verification - verify_jwt_token and generate_key_pair endpoints - Add Docker Compose config for test PostgreSQL and Redis - Add test data initialization SQL fixtures - Add test runner script (scripts/run_tests.sh) - Update GitHub Actions CI to run E2E tests with services - Update README with E2E testing documentation Co-authored-by: Cursor <cursoragent@cursor.com>
- test_sudo2_to_self_after_login: use user_app_info.id instead of hty_id (sudo2 endpoint requires user_app_info.id as path parameter) - test_verify_jwt_token_after_login: add missing HtyHost header Co-authored-by: Cursor <cursoragent@cursor.com>
The verify_jwt_token endpoint reads token from Authorization header, not from JSON body. Fixed both test_verify_jwt_token_invalid and test_verify_jwt_token_after_login tests. Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.